package cn.wolfcode.crm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

//退货订单
@Getter@Setter
public class StockOutcomeBill {
    public static final Integer NORMAL = 1; //未审核状态
    public static final Integer AUDIT = 2;  //已审核状态

    private Long id;

    private String sn; //退货编号

    private Supplier supplier; //供应商

    private BigDecimal totalNumber; //数量

    private BigDecimal totalAmount; //总额

    private Integer status = NORMAL; //状态

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime; //录入时间

    private Depot depot; //仓库

    //包含的退货明细,组合关系
    private List<StockOutcomeBillitem> items = new ArrayList<>();
}